﻿/**************************************************************
 * Copyright Eastmoney Corporation. All rights reserved.
 * 
 * Author: guitao(guitao@eastmoney.com) 
 * Create Date: 2019/11/5 16:32:16
 * Description:
 *          
 * Revision History:
 *      Date         Author               Description
 *              
***************************************************************/

using gt.dotnetcore.consolesample.Biz;
using Quartz;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace gt.dotnetcore.consolesample.Job
{
    [DisallowConcurrentExecution]
    public class TestJob : IJob
    {
        private ITest _testService;

        public TestJob(ITest testService)
        {
            _testService = testService;
        }

        public Task Execute(IJobExecutionContext context)
        {
            Console.WriteLine("job started");
            var t = _testService.Dowork(3);
            t.Wait();
            Console.WriteLine("job ended");

            return Task.CompletedTask;
        }
    }
}
